# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=waylock
pkgver=1.2.1
pkgrel=0
pkgdesc="A small screenlocker for Wayland compositors"
url="https://codeberg.org/ifreund/waylock"
arch="aarch64 x86_64"  # blocked by zig
license="ISC"
makedepends="
	libxkbcommon-dev
	linux-pam-dev
	scdoc
	wayland-dev
	wayland-protocols
	zig
	"
# downloads dependencies defined in build.zig.zon
options="net"
subpackages="$pkgname-doc"
source="https://codeberg.org/ifreund/waylock/releases/download/v$pkgver/waylock-$pkgver.tar.gz
	pam-base-auth.patch
	"

build() {
	DESTDIR='.dest' zig build \
		--prefix /usr \
		-Doptimize=ReleaseSafe \
		-Dcpu=baseline \
		-Dpie=true \
		-Dman-pages=true \
		--prefix /usr install
}

package() {
	mkdir -p "$pkgdir"
	cp -r .dest/* "$pkgdir"/
}

sha512sums="
e039de7056e55de88f3f332030de6e89c80762ba6406ba42e205710652262f88d83b5c45b186f94059a1544c29f4791db8c2593d59b076ef01157f7dd3193fcf  waylock-1.2.1.tar.gz
e3f5aa479908babbeea2febecdf7c57a5cf6b9153c4cd63731721cdf6d50bd0417077b37effec1520064918a422c4313d24ee9c2b2a77c328be931ffbeb03161  pam-base-auth.patch
"
